﻿using AutoMapper;
using GGetTestService.Dto.Student;
using GGetTestService.Entity;
using System;

namespace GGetTestService.Mapper.Profiles
{
    public class StudentProfile : Profile
    {
        public StudentProfile()
        {
            CreateMap<Student, StudentDto>()
                .ForMember(dst => dst.TeacherName, x => x.MapFrom(src => src.Teacher.Name));

            CreateMap<StudentAddDto, Student>()
                .ForMember(dst => dst.Id, x => x.MapFrom(y => Guid.NewGuid()));
        }
    }
}
